UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0R/auXvG7jGyRZCOom8XLjfrpu7rMiGbTHiiqCNN6Vg='
WHERE
key_id = '5000210a6b2e8a36cc5b71f9c55ed9accdc2f223bc6439cc54f3f552353c0253'
AND (
token = '0R/auXvG7jGyRZCOom8XLjfrpu7rMiGbTHiiqCNN6Vg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)