UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UQ6Vz0+GYT7ejJF/ERV0ijvqZb+gkbFnN2l2XJN57AA='
WHERE
key_id = 'f12d4602c9784d303c3cfaa0cfac59498f645e623c2dc3b4f020256682a1b4f8'
AND (
token = 'UQ6Vz0+GYT7ejJF/ERV0ijvqZb+gkbFnN2l2XJN57AA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)