UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SimBJ85FrocFzfqN0z3gvw4gVpr08rMNgRxYhCnXb1o=' 
WHERE 
  key_id = '822832ba5f32fa740d3f02e5fbfc620385660859c07468a75c5cdf590cda8261' 
  AND (
    token = 'SimBJ85FrocFzfqN0z3gvw4gVpr08rMNgRxYhCnXb1o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040