UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BJB5+lQ8ur0PIQgS3cjusyhdujjmshlHnC6QE/gSluU=' 
WHERE 
  key_id = '4e63052d7c4a58796ae2e3221933d40233875f9c367f9d1d4964aab619785b0e' 
  AND (
    token = 'BJB5+lQ8ur0PIQgS3cjusyhdujjmshlHnC6QE/gSluU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036