UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hOS9nSOHeH7rJWe3Yxvwm3d4VvSacVttXR1OjbM/AoI='
WHERE
key_id = '4057f384fc2b378f5816e39a63bc303622e299be10aa3caac23cb645492eec5e'
AND (
token = 'hOS9nSOHeH7rJWe3Yxvwm3d4VvSacVttXR1OjbM/AoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)