UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jVw/bamSFOH9wWYkk00n+si7EMJIQlcYjgHGfZ0oV6w='
WHERE
key_id = 'f3d9b1e292f8e4b02f78243167a7469fac276ef98c1557ae293a92b469b6cda9'
AND (
token = 'jVw/bamSFOH9wWYkk00n+si7EMJIQlcYjgHGfZ0oV6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)