UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zwyg6CofnXCd9kqoRj0sFuoH604U8J1fIBOj3wpGZWk=' 
WHERE 
  key_id = 'fde971090b02ef25dd6e5ba8c944d2a85fb7c1b554c36c3b3979e1b71205264d' 
  AND (
    token = 'zwyg6CofnXCd9kqoRj0sFuoH604U8J1fIBOj3wpGZWk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053