UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1pddpp+i+dmavxjbz94cVen3fuujyWO+bY1YqFebU7I='
WHERE
key_id = 'daf11f43723f0ef331d4b92b13d3803560a0fab6e70876759e9bf75249cd0fc0'
AND (
token = '1pddpp+i+dmavxjbz94cVen3fuujyWO+bY1YqFebU7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)