UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zi+FrlSce8+enaGjOabZ9mh73GRtSTH7w06Eq6LgpTo=' 
WHERE 
  key_id = 'aabb264300e66ea6af4bee024f85cdb6769de90f83c1ae460654a39f93039bd4' 
  AND (
    token = 'zi+FrlSce8+enaGjOabZ9mh73GRtSTH7w06Eq6LgpTo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024