UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KA3jV3gs9vvYeMVr1Dc1ye06XaNVRo7YhWJluR9L08s='
WHERE
key_id = '1134dd388a674acc16dd8f8cf4074efca42a95c22a4939b831d6dc7756100844'
AND (
token = 'KA3jV3gs9vvYeMVr1Dc1ye06XaNVRo7YhWJluR9L08s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)