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

Query time 0.00032