UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3puGizOjqkYB8tKAuVdnAnh9E5npH5SVunuDyrBImEw=' 
WHERE 
  key_id = '9977903a5eeca225af9ccf84354f3b573eef40b5b83f1f8768ab78125f93cb52' 
  AND (
    token = '3puGizOjqkYB8tKAuVdnAnh9E5npH5SVunuDyrBImEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045