UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5SWnFqra0PnhumiO6k5K3vJ/dkIcmL2aisbtOJG/c/Y='
WHERE
key_id = 'd80aab4784b4a2be65c3e0f2250e6fdaeec5841a465b4ad2792783702e93a46d'
AND (
token = '5SWnFqra0PnhumiO6k5K3vJ/dkIcmL2aisbtOJG/c/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)