UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Q45fo/lkVv0Q5Oy9hxQGSL1bt51O4yaVhN96IWYxBw=' 
WHERE 
  key_id = '8b6657e44338dfa7230d44dd4744cdebd96aa0e26d7a6cfa1e9d847e87aea840' 
  AND (
    token = '2Q45fo/lkVv0Q5Oy9hxQGSL1bt51O4yaVhN96IWYxBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044