UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wrxv3vdIaBXlRJ5zhydCNeEfXUKqpH24emiJOJGcNB0='
WHERE
key_id = '98d4e1525880e79593781c582e3a07d0adc56bbe86bce18c86e1d871f3e584ad'
AND (
token = 'Wrxv3vdIaBXlRJ5zhydCNeEfXUKqpH24emiJOJGcNB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)