UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Fz4WILtYtrNqW2RUxB0sN5QEvXch7EXAgERatY2G+M='
WHERE
key_id = 'c95f5ec4ed462b350dfd1e26d152b1b6e2e890028417fb2925bec855cc252144'
AND (
token = '4Fz4WILtYtrNqW2RUxB0sN5QEvXch7EXAgERatY2G+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)