UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iXugXSGYorX5/x6DA28snyKluNqInk2UMmtZ3sW57cs='
WHERE
key_id = 'd2a573612f8faa4eed419260d12581c443af2224620f759b442e02438c216e0f'
AND (
token = 'iXugXSGYorX5/x6DA28snyKluNqInk2UMmtZ3sW57cs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)