UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GieN//lbPgfBW044pLd1nq0Pfyl+VmOiUl27TphjBnY=' 
WHERE 
  key_id = '7d2dce334d7d4bf8e29aeae21cfa24e966336aab90ea3b9881d630e192df8668' 
  AND (
    token = 'GieN//lbPgfBW044pLd1nq0Pfyl+VmOiUl27TphjBnY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028