UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TYdv25/4WR5PRpa5qBPIrAjnNd+Be3rAqIumJWbpeSw='
WHERE
key_id = 'ae88e556882f31290505f3918d59d340825b02d653e19d8b86ca9b0bf4cae943'
AND (
token = 'TYdv25/4WR5PRpa5qBPIrAjnNd+Be3rAqIumJWbpeSw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)