UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YGprr+87SoVRQoc+qfexnnoAFH9JKNpDUZoOvh2AoN4='
WHERE
key_id = 'c757c82663df03f424bb0be2d973ad3bd752f5598f4d5d2658f6cc349ee7386e'
AND (
token = 'YGprr+87SoVRQoc+qfexnnoAFH9JKNpDUZoOvh2AoN4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)