UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4dfiZ1yNKgDPM0w7wTaJyIjtB/CpnAd+jPAybGLlq4g='
WHERE
key_id = 'e2704bfa24dfdbec69cc849313388cdd6f1aa73e63c059a9870e143d1e318fe0'
AND (
token = '4dfiZ1yNKgDPM0w7wTaJyIjtB/CpnAd+jPAybGLlq4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)