UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1mvJReK1+gycBfejt6lPh2A69ghnkbGBnKmKHp/k2w8='
WHERE
key_id = 'aadc8c3d6dc60481ea695e08ecc0449f0a0e3ab84b64ce285c2e2d40790e7f6f'
AND (
token = '1mvJReK1+gycBfejt6lPh2A69ghnkbGBnKmKHp/k2w8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)