UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ARzvxEVsxKI2hEtx7guJEZVd09FbiTXn5pJtaN9CkF4='
WHERE
key_id = 'cb6bdc4dd3ef48b9e06fb584d9277b3e2b941615930023f3e4b22be6806227d1'
AND (
token = 'ARzvxEVsxKI2hEtx7guJEZVd09FbiTXn5pJtaN9CkF4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)