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

Query time 0.00050