UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+ctLHP1MjpdzkoA6CusTVgPhIRsFafCyqwHXrAW0cOM='
WHERE
key_id = '968fdea823ddfcb3615e51d0ff9a8b66c00a4b4a753f2de0b109dc0b7eb347a3'
AND (
token = '+ctLHP1MjpdzkoA6CusTVgPhIRsFafCyqwHXrAW0cOM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)