UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aoBKYc19Bu2TWVHlgHPolfwcWVTaNXt6qmnxK3EmipI='
WHERE
key_id = '7a063a2b68454c292826cae006a1e814cac7b3e8900bc5f7e18b40e520edb484'
AND (
token = 'aoBKYc19Bu2TWVHlgHPolfwcWVTaNXt6qmnxK3EmipI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)