UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5fbqu65g/HgR65wipuKzPpITGeAIGWlp+x9ZDGmRZ1A=' 
WHERE 
  key_id = '76fdb815acb5fad76d1899bd87dbf7f8b59d18a11c0e08cdb7e7fe6a9671471d' 
  AND (
    token = '5fbqu65g/HgR65wipuKzPpITGeAIGWlp+x9ZDGmRZ1A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038