UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vShfZz/Iwsv0P+izg3CWKssbyl+Mw/UkgpftkD7VmKA=' 
WHERE 
  key_id = '9e6289366f42bcbbcb1fdef73aff464d522e908407496821247fb1996cd571fa' 
  AND (
    token = 'vShfZz/Iwsv0P+izg3CWKssbyl+Mw/UkgpftkD7VmKA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017