UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V9ds4FKQe5x+ITUlH4nNlMDzvHmqeQK6nwmCJ00e7qo='
WHERE
key_id = 'd26f30dbd2aaf38e45ca00a6abdfb6ee19d54cb2065d4f4aacd8fc37016d623e'
AND (
token = 'V9ds4FKQe5x+ITUlH4nNlMDzvHmqeQK6nwmCJ00e7qo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)