UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YG2+VRw+Ryujagkpr9TzILGwnMNAOKU+gii1/U5AXhE='
WHERE
key_id = 'a4f9d664696b8af416f32937fc4f1a4f01cc9ceff2d1c377a7fb2b325e5955de'
AND (
token = 'YG2+VRw+Ryujagkpr9TzILGwnMNAOKU+gii1/U5AXhE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)