UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7oHH/uj6L8oqIkvKmQVAipylR+XJRvbhyDErbUit9hs='
WHERE
key_id = 'e95a4ddc7a4188591e6946ebaccce4976ae31751896f9b71b3578788f8f5fa17'
AND (
token = '7oHH/uj6L8oqIkvKmQVAipylR+XJRvbhyDErbUit9hs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)