UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n2I60WThbT5zmgqvkWgd6+Qs+JE3j6YYYTB6ylPQOKQ=' 
WHERE 
  key_id = '14ef825de38864a67f61b8c5403402ac3bd4b66c3cb9e11119e6f034e286e8ca' 
  AND (
    token = 'n2I60WThbT5zmgqvkWgd6+Qs+JE3j6YYYTB6ylPQOKQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029