UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nkybo2BpisZJcQ0wsbFoDcGChm5YIRK13ukgOvZNAZM=' 
WHERE 
  key_id = 'e5b513f3f3aee6387420a8dddbf5d0f19cbc41062ea78de14a6df2ad9f531dcf' 
  AND (
    token = 'Nkybo2BpisZJcQ0wsbFoDcGChm5YIRK13ukgOvZNAZM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036