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