UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BzmIroqIJlN2FkCGvT90k4ZFjHfCVBa1ZoOfbiML0I8='
WHERE
key_id = '9ebd533020c17e2bb27ac2687c52fad04aac3711a1286e1ce5e0fb0b9182d04b'
AND (
token = 'BzmIroqIJlN2FkCGvT90k4ZFjHfCVBa1ZoOfbiML0I8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)