UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AraCKWGBHaZXNMZmzFUYSgqRCpAJaBkkHPXv5k/+Z5Q='
WHERE
key_id = '18b00449035cf1098956961581eaaaa79a8e06022f33bfd3f5fbb04ae829a439'
AND (
token = 'AraCKWGBHaZXNMZmzFUYSgqRCpAJaBkkHPXv5k/+Z5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)