UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A5Y/4FpgzCwzYK70RkzHkcJNOd4MSDygYOTjDlvyfWw=' 
WHERE 
  key_id = '57b8c439ef86ac1bb5669a2c8f98c384f47bc44d7490e09d23781c1048490dda' 
  AND (
    token = 'A5Y/4FpgzCwzYK70RkzHkcJNOd4MSDygYOTjDlvyfWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018