UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sO1qVsOyobcB5ZYGMO/kbA9mtPJe6C12ugNT/nlsYcY='
WHERE
key_id = 'd5334c13e9ac11f01b02ffbcc1beaa4e735b8a4ca69e2f03d0369e14f810d683'
AND (
token = 'sO1qVsOyobcB5ZYGMO/kbA9mtPJe6C12ugNT/nlsYcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)