UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nKSxGqZ39IpkHZ49dY1gRA5bVfxKchCfckCibq+dD7Q='
WHERE
key_id = '0b9870f6bf692760224b1d3cb6e5e158e9c9979e3d97f6648b951e5c363e55ac'
AND (
token = 'nKSxGqZ39IpkHZ49dY1gRA5bVfxKchCfckCibq+dD7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)