UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MfX7Y2Fx5ndb+YV0OXa6bXeu1/IUXVl/viK2av330gU=' 
WHERE 
  key_id = '10549e67ff0241cba9146fcabcf068edcdf90006e20d03b12bbcbbdcdd90b811' 
  AND (
    token = 'MfX7Y2Fx5ndb+YV0OXa6bXeu1/IUXVl/viK2av330gU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040