UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LihMFfnMTjq5n/BPidBjRyn/QiCuzxsxr1lG/LMXOCw='
WHERE
key_id = '286fb03f7b09d4b4cc1e9b8da23beb72032bd6993d89ea60f5be313f8e67f96a'
AND (
token = 'LihMFfnMTjq5n/BPidBjRyn/QiCuzxsxr1lG/LMXOCw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)