UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tlp5yhQFkS+y4zCx4yNb8Wnv0oc2RervzIxWKjp8vzQ=' 
WHERE 
  key_id = '6e1b79284cf2c52f9f304fc50e8ae8056235fd54a7ec6ef220507fed5f7ad33f' 
  AND (
    token = 'Tlp5yhQFkS+y4zCx4yNb8Wnv0oc2RervzIxWKjp8vzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057