UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tzPvqaYfbbsTwYPjrptbAb/i6WDZHD1m3WLXWcqWzhQ=' 
WHERE 
  key_id = '362b03cb0eafe45a2b125106b798dbd61102d628ba44887ee595b3b557844b73' 
  AND (
    token = 'tzPvqaYfbbsTwYPjrptbAb/i6WDZHD1m3WLXWcqWzhQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040