UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nq/fpKvY3UFtP5P8nr0duXMx8xczfwjVezlnke51RXo=' 
WHERE 
  key_id = '2601601dff900d76304cd139f16ba394dc75ff01f4910e6831d33935a7014d88' 
  AND (
    token = 'Nq/fpKvY3UFtP5P8nr0duXMx8xczfwjVezlnke51RXo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041