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

Query time 0.00017