UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CjxS5kbv2RwdzS0+G+O5drnF56lcszRZBZBGW6yappM='
WHERE
key_id = '819162532e354495fc7ba0a1bdcd1b286ff02a9ee10ab573739c95d2eaed6407'
AND (
token = 'CjxS5kbv2RwdzS0+G+O5drnF56lcszRZBZBGW6yappM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)