UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SezKQ6kwzDGOP7S8PzFhuHs8cvWTphyZm78q6nI7Z0o=' 
WHERE 
  key_id = '9a402d91c0ccfd566840cfcf7e8950b3b732e6f4e37fa948ac9abe69d6fc5c8a' 
  AND (
    token = 'SezKQ6kwzDGOP7S8PzFhuHs8cvWTphyZm78q6nI7Z0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00181