UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h3d3rx0U63PBH6JOzJ5RYffJ/nnfq/FrJKJcGNXlIy0='
WHERE
key_id = 'ab8d2b6836a5cb4a54cfe62a36594539d1eb95e9b29dc2b25845b373cb6ff8ff'
AND (
token = 'h3d3rx0U63PBH6JOzJ5RYffJ/nnfq/FrJKJcGNXlIy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)