UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CahR0c/rUlQYuZl2OVDPN1kj5YWDhs+bE8EmZmYPGjI='
WHERE
key_id = '32fa3cb1e935aa35207c85621abe1f607f9f0d1857f5063b086204dea3673ada'
AND (
token = 'CahR0c/rUlQYuZl2OVDPN1kj5YWDhs+bE8EmZmYPGjI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)